<template>
  <div>
    <!-- 卡片区 -->
    <el-card>
      <div class="box">
        <img :src="userStore.avatar" />
        <div>
          <div class="title">{{ getTime() }}好，{{ userStore.userName }}</div>
          <div class="subtitle">欢迎来到极客映像后台管理系统</div>
        </div>
      </div>
    </el-card>
    <!-- 底部图片 -->
    <div class="bottomImg">
      <svg-icon name="welcome" width="500px" height="500px"></svg-icon>
    </div>
  </div>
</template>

<script setup lang="ts">
import { onMounted } from 'vue'
import useUserStore from '@/store/modules/user'
import { getTime } from '@/utils/time'
const userStore = useUserStore()
//首页挂载完毕，发送请求获取用户信息
onMounted(() => {
  userStore.userInfo()
})
</script>

<style scoped lang="scss">
.box {
  display: flex;
  align-items: center;

  img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin-right: 30px;
  }

  .title {
    font-size: 28px;
    margin-bottom: 15px;
  }

  .subtitle {
    color: #ccc;
  }
}

.bottomImg {
  display: flex;
  justify-content: center;
  margin-top: -69px;
}
</style>
